package com.qxglxt.qxgl.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import com.qxglxt.qxgl.dao.IUserRolesDao;
import com.qxglxt.qxgl.model.UserRoles;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("userroles")
public class UserRolesController {
    @Resource
    private IUserRolesDao userrolesDao;

    @ApiOperation(value = "查询所有用户", notes = "查询所有用户")
    @GetMapping
    public Map<String, Object> findAll() {
        List<UserRoles> list = userrolesDao.findAll();
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("code", 0);
        map.put("msg", "成功");
        map.put("count", userrolesDao.count());
        map.put("data", list);
        return map;
    }
}